import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes: [{
            path: '/',
            redirect: 'home'
        },
        {
            path: '/login',
            name: 'login',
            component: () =>
                import ('./views/login.vue'),
        },
        {
            path: '/home',
            name: 'home',
            component: () =>
                import ('./views/home.vue'),
            children: [{
                path: '',
                component: () =>
                    import ('./views/index.vue'),
                meta: {
                    title: ['首页'],
                    keepAlive: true
                }
            },
            {
                path: '/administration',
                component: () =>
                    import ('./views/administration.vue'),
                meta: {
                    title: ['管理'],
                    keepAlive: true
                }
            },
            {
                path: '/upload',
                component: () =>
                    import ('./views/upload.vue'),
                meta: {
                    title: ['上传'],
                    keepAlive: true
                }
            },
        ]
        }
    ]
})